package net.chrisrichardson.cloudtools.maven.plugins;

import java.util.ArrayList;
import java.util.List;

import net.chrisrichardson.ec2deployer.cluster.ClusterManager;
import net.chrisrichardson.ec2deployer.cluster.SimpleCluster;

/**
 * Goal for taking a snapshot of the database
 * @goal sql
 * @author cer
 *
 */
public class SqlMojo extends AbstractClusterMojo {

  /**
   * S3 script
   * 
   * @parameter expression="${cloudtools.sql.script}" 
   * @required
   */
  protected String sqlScript;

  @Override
  protected void executeWithCluster(ClusterManager manager, SimpleCluster cluster) {
    List<String> scripts = new ArrayList<String>();
    scripts.add(sqlScript);
    cluster.executeSqlScripts(scripts);
  }

}
